package com.ss.android.common.location;

import android.content.Context;
import android.util.Log;

import com.bytedance.article.b.a.i;
import com.bytedance.common.plugin.faces.LiteProxy;
import com.bytedance.common.plugin.interfaces.location.ILocation;

import org.json.JSONObject;

public final class LocationGaoDeHelper {
    private static LocationGaoDeHelper a;
    private Context b;

    private LocationGaoDeHelper(Context context) {

        this.b = context.getApplicationContext();
        i v1 = i.a();
        if (context != null && v1.a == null) {
            try {
                LiteProxy v0_1 = LiteProxy.inst();
                if (!(v0_1 instanceof ILocation)) {
                    return;
                }
                v1.a = v0_1;
            } catch (Throwable v0) {
                Log.d("DexParty", "load GaodeLocationAdapter exception: " + v0);
            }
        }
    }

    public static LocationGaoDeHelper a(Context arg3) {
        LocationGaoDeHelper v0_1;
        Class v1 = LocationGaoDeHelper.class;
        synchronized (v1) {
            if (a == null) {
                a = new LocationGaoDeHelper(arg3.getApplicationContext());
            }

            v0_1 = a;
        }
        return v0_1;
    }

    public final JSONObject a() {
        JSONObject v0_1;
        synchronized (this) {
            v0_1 = i.a().getLocationData(this.b);
        }
        return v0_1;
    }

    public final void a(boolean arg4) {
        i.a().tryLocale(this.b, arg4, false);
    }

    public final boolean a(long arg4) {
        return i.a().isDataNew(this.b, arg4);
    }
}

